<template>
  <div id="careerplan-preview">
    <p>
      <span
        @click="$router.go(-1)"
        style="margin-right: 20px;cursor: pointer;font-size: 14px"
        ><i class="el-icon-arrow-left"></i>返回</span
      >职业规划预览
    </p>
    <div class="careerplan-preview-wrap">
      <div class="careerplan-warp" v-if="careerplan.careerplan_id">
        <div class="careerplan-message">
          <p class="careerplan-title">-{{ careerplan.title }}</p>
          <div class="careerplan-sub-message">
            <span class="message-info">简介: </span>{{ careerplan.sub_message }}
          </div>
        </div>
        <div v-html="careerplan.content_html"></div>
      </div>
      <div class="pre-next-wrap" v-if="isexpert">
        <span
          class="pre-wrap"
          v-if="pn.pre"
          @click="
            $router.push({
              name: 'careerplanPreview',
              query: { careerplan_id: pn.pre.careerplan_id }
            })
          "
        >
          <i class="el-icon-arrow-left"></i>
          {{ pn.pre.title }}
        </span>
        <span
          class="next-wrap"
          v-if="pn.next"
          @click="
            $router.push({
              name: 'careerplanPreview',
              query: { careerplan_id: pn.next.careerplan_id }
            })
          "
        >
          {{ pn.next.title }}
          <i class="el-icon-arrow-right"></i>
        </span>
      </div>
      <!-- <careerplan-comments :id="careerplan.careerplan_id" />
      <no-data v-if="!careerplan.careerplan_id" text="没有找到该职业规划~" /> -->
    </div>
  </div>
</template>

<script>
import { getCareerPlan } from '@/network/career'

export default {
  name: 'previe',
  data() {
    return {
      careerplan: {},
      timeslot: {},
      pn: {},
      isexpert: false
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      let params = { careerplan_id: this.$route.query.careerplan_id }
      getCareerPlan(params).then(res => {
        this.careerplan = res.data
      })
    }
  }
}
</script>

<style></style>
